package com.java1412.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 作为feign的客户端
 *
 * @author java1412
 * @since 2024-04-19 14:08:31
 */
// value：调用的服务提供者的应用名,fallback：指定当前兜底方案所在的实现类，但是实现类需要实现当前的接口，按照同名方法进行兜底
@FeignClient(value = "SERVICE-HI", fallback = SchedualServiceHiHystrix.class)
public interface SchedualServiceHi {
    @RequestMapping(value = "/hi")
    public String sayHiFromClientOne(
            @RequestParam(value = "name", required = false, defaultValue = "java1412") String name
    );
}
